//
//  MCNewMarketingHead_timeView.swift
//  StoreManage
//
//  Created by MC on 2018/6/26.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCNewMarketingHead_timeView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
       
        
        self.addSubview(activityTitleLabel)
        activityTitleLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.height.equalTo(34)
            make.top.equalTo(self).offset(10)
        }
        
        self.addSubview(activityBeginTimeView)
        activityBeginTimeView.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(self).offset(5)
            make.right.equalTo(self).offset(-5)
            make.top.equalTo(activityTitleLabel.snp.bottom)
            make.height.equalTo(44)
        }

        self.addSubview(activityEndTimeView)
        activityEndTimeView.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(self).offset(5)
            make.right.equalTo(self).offset(-5)
            make.top.equalTo(activityBeginTimeView.snp.bottom)
            make.height.equalTo(44)
        }

        self.addSubview(lineView)
        lineView.snp.remakeConstraints { (make) ->Void in
            make.left.right.equalTo(self)
            make.height.equalTo(1)
            make.top.equalTo(activityEndTimeView.snp.bottom).offset(-1)
        }
     
        
        self.addSubview(pickUpTitleLabel)
        pickUpTitleLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.height.equalTo(34)
            make.top.equalTo(lineView.snp.bottom).offset(10)
        }
        
        self.addSubview(pickUpPromptLabel)
        pickUpPromptLabel.snp.remakeConstraints { (make) ->Void in
            make.centerY.equalTo(pickUpTitleLabel).offset(1)
            make.left.equalTo(pickUpTitleLabel.snp.right).offset(5)
        }
        
        self.addSubview(pickUpBeginTimeView)
        pickUpBeginTimeView.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(self).offset(5)
            make.right.equalTo(self).offset(-5)
            make.top.equalTo(pickUpTitleLabel.snp.bottom)
            make.height.equalTo(44)
        }
        
        self.addSubview(pickUpEndTimeView)
        pickUpEndTimeView.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(self).offset(5)
            make.right.equalTo(self).offset(-5)
            make.top.equalTo(pickUpBeginTimeView.snp.bottom)
            make.height.equalTo(44)
        }

    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private lazy var activityTitleLabel: UILabel = {
        let label = UILabel()
        label.font = UIFont.boldSystemFont(ofSize: 16)
        label.textColor = UIColor.MCWords
        label.text = "活动时间"
        return label
    }()

    public lazy var activityBeginTimeView: MCAddTicketEventView = {
        let view = MCAddTicketEventView()
        view.titleLabel.text = "活动开始时间"
        view.contentButton.setTitle("请选择开始时间", for: UIControlState.normal)
        return view
    }()
    
    public lazy var activityEndTimeView: MCAddTicketEventView = {
        let view = MCAddTicketEventView()
        view.titleLabel.text = "活动结束时间"
        view.contentButton.setTitle("请选择结束时间", for: UIControlState.normal)
        
        return view
    }()
    
    private lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.MCGray_light
        return view
    }()
    
    private lazy var pickUpTitleLabel: UILabel = {
        let label = UILabel()
        label.font = UIFont.boldSystemFont(ofSize: 16)
        label.textColor = UIColor.MCWords
        label.text = "提货时间"
        return label
    }()
    
    private lazy var pickUpPromptLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(13)
        label.textColor = UIColor.MCMain
        label.text = "(注意考虑运输时间，合理设置提货时间)"
        return label
    }()

    
    public lazy var pickUpBeginTimeView: MCAddTicketEventView = {
        let view = MCAddTicketEventView()
        view.titleLabel.text = "提货开始时间"
        view.contentButton.setTitle("请选择开始时间", for: UIControlState.normal)
        return view
    }()
    
    public lazy var pickUpEndTimeView: MCAddTicketEventView = {
        let view = MCAddTicketEventView()
        view.titleLabel.text = "提货结束时间"
        view.contentButton.setTitle("请选择结束时间", for: UIControlState.normal)
        view.lineView.isHidden = true

        return view
    }()


}
